/*	编写程序统计某个用户给定的整数中的数位个数.
 *
 */

#include<stdio.h>

int main() {
	printf("输入一个整数:");
	int num = 0, num1 = 0;
	scanf("%d", &num);
	num1 = num;

	//取绝对值
	num = (num >= 0) ? num : 0 - num;			//-2147483648是1位数.此时负数超量程.具体问题待分析
	int shuwei = 0;
	while (num > 0) {
		num = num / 10;
		shuwei++;
	}
	printf("%d是%d位数\n", num1, shuwei);
	return 0;
}
